package org.iabako.shared.iservice.business;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import org.iabako.shared.entity.business.Sale;
import org.iabako.shared.entity.business.SaleProductService;
import org.iabako.shared.iservice.generic.BusinessEntityServiceAsync;
import org.iabako.shared.iservice.generic.CRUDServiceAsync;
import org.iabako.shared.iservice.generic.SearchServiceAsync;

import java.util.List;

/**
 * Created by jose on 12/07/15.
 */
public interface QuoteServiceAsync extends SearchServiceAsync, CRUDServiceAsync, BusinessEntityServiceAsync {

    void save(Sale sale, List<SaleProductService> productsServices, AsyncCallback<Sale> async);

    public static final class Util {
        private static QuoteServiceAsync instance;

        public static final QuoteServiceAsync getInstance() {
            if (instance == null) {
                instance = GWT.create(QuoteService.class);
            }
            return instance;
        }
    }
}
